// src/router/index.js
import { createRouter, createWebHashHistory } from 'vue-router'
import Main from '@/views/Main.vue'

// 学生管理页面
import StudentGrade1 from '@/views/student/StudentGrade1.vue'
import StudentGrade2 from '@/views/student/StudentGrade2.vue'
import StudentGrade3 from '@/views/student/StudentGrade3.vue'

// 班级管理页面
import ClassGrade1 from '@/views/class/ClassGrade1.vue'
import ClassGrade2 from '@/views/class/ClassGrade2.vue'
import ClassGrade3 from '@/views/class/ClassGrade3.vue'

const routes = [
  {
    path: '/',
    component: Main,
    redirect: '/student/grade1',
    children: [
      // 学生管理
      { path: '/student/grade1', component: StudentGrade1, meta: { title: '学生管理-一年级' } },
      { path: '/student/grade2', component: StudentGrade2, meta: { title: '学生管理-二年级' } },
      { path: '/student/grade3', component: StudentGrade3, meta: { title: '学生管理-三年级' } },

      // 班级管理
      { path: '/class/grade1', component: ClassGrade1, meta: { title: '班级管理-一年级' } },
      { path: '/class/grade2', component: ClassGrade2, meta: { title: '班级管理-二年级' } },
      { path: '/class/grade3', component: ClassGrade3, meta: { title: '班级管理-三年级' } }
    ]
  }
]


export default createRouter({
  history: createWebHashHistory(),
  routes
})